/*
 * @LastEditTime : 2022-10-28 10:35:20
 * @FilePath     : /pyy/src/http/moduleswebjars/physics.js
 * @Description  : api > 物理分析
 */
import axios from "@/utils/axios";

/**
 * 人员唯一标识
 */
const OPEN_ID = localStorage.userId;
// const OPEN_ID = 221122;

export default {
  /**
   * 获取 列表数据
   * @param {object} params: 请求参数
   * @param {number} params.page: 分页页码
   * @param {number} params.size: 分页条数
   * @param {string} params.query: 模糊查询数据
   */
  getList(params) {
    return axios({
      url: "webjars/physics/getPhysicsList/" + OPEN_ID,
      method: "POST",
      data: params,
    });
  },
        /**
       * 查看证书详情
       * 
       */
  checkTheCertificateDetails(id) {
    return axios({
      url: "webjars/file/downloadService/"+ id ,
      method: "GET",

    });
},

  /**
   * 获取 物理检测表单枚举
   * @return {PromiseLike<{data:{"物理实验室选择":[{ id: null, name: null, code: null}]}}>}
   */
  getEnum() {
    return axios({
      url: "webjars/physics/getFirstPhysicsEnum",
      method: "GET",
    });
  },

  /**
   * 通过 检验机构 获取 检测大类、检测小类 数据
   * @param {string} enumID: 检验机构ID
   */
  getCategoryEnum(enumID) {
    return axios({
      url: "webjars/physics/getSecondPhysicsEnum/" + enumID,
      method: "GET",
    });
  },

  /**
   * 流程发起
   */
  addProcess(params) {
    return axios({
      url: "webjars/physics/sendPhysicsProcess/" + OPEN_ID,
      method: "POST",
      data: params,
    });
  },
  /**
   * 支付
   */
   payMoney(summaryId,money,code) {
    return axios({
      url: "/webjars/icbc/pankPay/" +summaryId +'/'+money+'/'+code+'/'+OPEN_ID,
      method: "GET",
    });
  },
  /**
   * 获取 物理分析检测-数据详情
   * @param {string} id: 物理分析检测列表项id
   */
  getDetail(id) {
    return axios({
      url: "webjars/physics/getPhysicsDetails/" + id,
      method: "GET",
    });
  },
};
